

<%@page import="cs4280.dao.MovieDAO"%>
<%--
    Document   : index
    Created on : 2011-3-22, 11:19:34
    Author     : PangPei
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList, java.util.Iterator, cs4280.bean.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Cult Cinema</title>
        <meta name="keywords" content="" />
        <meta name="description" content="This web site exists to fulfill the coursework requirement of CS4280.
              Do not use your real personal data as input." />
        <link href="default.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="jquery/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="jquery/jquery.slidertron-0.1.js"></script>
        <script type="text/javascript" src="jquery.twitter.js"></script>
        <link rel="stylesheet" href="jquery.twitter.css" type="text/css" media="all"/>
        <style type="text/css">

            @import "gallery.css";

        </style>


    </head>
    <body><div id="wrapper">
            <div id="header">
                <div id="logo">
                    <h1><a href="#">CultCinema </a></h1>
                    <h2><a href="#">By Phoena and Yvonne</a></h2>
                </div>

                <!-- end div#logo -->

                <div id="menu">
                    <ul>
                        <form name="home" id="home" method="post" action="index.do">
                            <li ><a onclick="home.submit();">Homepage</a></li>
                        </form>
                        <form name="movie" id="movie" method="post" action="movieControl.do">
                            <li ><a onclick="movie.submit();" >Movies</a></li>
                        </form>

                        <form name="discuss" id="discuss" method="post" action="/assignmentCinema/">
                            <input type="hidden" name="todo" id="todo" value="messageBox" />
                            <li><a onclick="discuss.submit();">Discuss</a></li>
                        </form>

                        <form name="manage" id="manage" method="post" action="memberControl.do">
                            <li class="active"><a onclick="manage.submit();">Manage</a></li>
                        </form>
                    </ul>
                </div>

                <!-- end div#menu -->

            </div>
        </div>

        <div>
            <div id="page">
                <div id="page-bgtop">
                    <div id="content">
                        <div id="gallery-bg">
                            <div id="gallery-bgtop">
                                <div id="gallery-bgbtm">
                                    <div id="foobar">
                                        <div class="navigation"> <a href="#" class="first">[ &lt;&lt; ]</a> &nbsp; <a href="#" class="previous">[ &lt; ]</a> &nbsp; <a href="#" class="next">[ &gt; ]</a> &nbsp; <a href="#" class="last">[ &gt;&gt; ]</a> </div>

                                        <div class="viewer">
                                            <div class="reel">
                                                <div class="slide"> <img src="images/img13.jpg" alt=""> <span>Phoena and Yvonne.</span> </div>
                                                <div class="slide"> <img src="http://www.blog.spoongraphics.co.uk/wp-content/uploads/2011/soldier-character/vector-soldier-character.jpg" alt=""> <span>Phoena.</span> </div>
                                                <div class="slide"> <img src="http://www.blog.spoongraphics.co.uk/wp-content/uploads/2010/reindeer/reindeer-character-sm.jpg" alt=""> <span>Yvonne.</span> </div>
                                                <div class="slide"> <img src="http://www.blog.spoongraphics.co.uk/wp-content/uploads/2009/12/1.png" alt=""> <span>Phoena and Yvonne.</span> </div>
                                            </div>
                                        </div>
                                    </div>
                                    <script type="text/javascript">

                                        $('#foobar').slidertron({
                                            viewerSelector:			'.viewer',
                                            reelSelector:			'.viewer .reel',
                                            slidesSelector:			'.viewer .reel .slide',
                                            navPreviousSelector:	'.previous',
                                            navNextSelector:		'.next',
                                            navFirstSelector:		'.first',
                                            navLastSelector:		'.last'
                                        });
                                    </script>
                                    <!-- end -->

                                </div>
                            </div>
                        </div>
                        <div class="post">
                            <div class="post-bgtop">
                                <div class="post-bgbtm">
                                    <div class="entry">

<%@page import="cs4280.bean.*" %>

<script type="text/javascript">

    function doUpdateMovie() {
        document.getElementById("frmMovie").todo.value = "doupdatemovie";
        if(document.getElementById("duration").value=="")
            alert("Movie duration cannot be empty!");
        else if(document.getElementById("genere").valueL=="")
            alert("Movie genre cannot be empty!");
        else if(document.getElementById("actor").value=="")
            alert("Movie actor cannot be empty!");
        else if(document.getElementById("movielang").value=="")
            alert("Movie language cannot be empty!");
        else if(document.getElementById("opendate").value=="")
            alert("Movie opendate cannot be empty!");
        else if(document.getElementById("storyline").value=="")
            alert("Movie story line cannot be empty!");
        else if(document.getElementById("imgurl").value=="")
            alert("Movie img url cannot be empty!");
        else

        document.getElementById("frmMovie").submit();

    }

</script>

<h1>Update a Movie</h1>
<jsp:useBean id="movie" type="cs4280.bean.Movie" scope="request"/>
<style type="text/css">
    .updateHeader{width: 100px;}
.updateContent{margin-left: 50px;
              
}

</style>
<br/>

<form name="frmMovie" id="frmMovie" method="post" action="<jsp:expression>(String)request.getAttribute("javax.servlet.forward.request_uri")</jsp:expression>">
    <input type="hidden" name="todo" id="todo" value="" />
    <input type="hidden"  name="name" id="name" value="<%=String.valueOf(movie.getName())%>"/>
    <table  id="details">
        
        <tbody>
            <tr>
                <td class="updateHeader">Name:</td>

                <td ><%=String.valueOf(movie.getName())%></td>
            </tr>
            <tr>
                <td class="updateHeader">Duration:</td>
                <td><input type="text"  name="duration" id="duration" size="64" value="<%=String.valueOf(movie.getDuration())%>"/></td>
            </tr>
            <tr>
                <td class="updateHeader">Genre:</td>
                <td><input type="text" name="genere" id="genere" size="64" value="<%=String.valueOf(movie.getGenere())%>"/></td>
            </tr>
            <tr>
                <td class="updateHeader">Actor:</td>
                <td><input type="text" name="actor" id="actor" size="64" value="<%=String.valueOf(movie.getActor())%>" /></td>
            </tr>
            <tr>
                <td class="updateHeader">Language:</td>
                <td><input type="text" name="movielang" id="movielang"size="64"  value="<%=String.valueOf(movie.getMovieLang())%>" /></td>
            </tr>
            <tr>
                <td class="updateHeader">Open date:</td>
                <td><input type="text" name="opendate" id="opendate" size="64" value="<%=String.valueOf(movie.getOpendate())%>"/></td>
            </tr>
            <tr>
                <td class="updateHeader">Story line:</td>
                <td><textarea name="storyline" cols="50" rows="8"id="storyline"><%=String.valueOf(movie.getStoryLine())%></textarea></td>
            </tr>

            <tr>
                <td class="updateHeader">Image url:</td>
                <td><input type="text" name="imgurl" id="imgurl" size="64" value="<%=String.valueOf(movie.getImgurl())%>"/></td>
            </tr>


        </tbody>
    </table>
    <input type="button" name="btnSubmit" value="Update Movie" onclick="doUpdateMovie();"/>
</form>

                                    </div>
                                </div>
                            </div>
                        </div>


                    </div>

                    <!-- end div#content -->

                    <jsp:include page="/WEB-INF/jsp/_sidebar.jsp"/>

                    <!-- end div#sidebar -->

                    <div style="clear: both; height: 1px"></div>
                </div>
            </div>
            <!-- end div#page -->

        </div>
        <!-- end div#wrapper -->

        <div id="footer-wrapper">
            <div id="footer">
                <p id="legal">Copyright &copy; 2007 CYPP . All Rights Reserved. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
                <p id="links"><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a></p>
            </div>
        </div>

        <!-- end div#footer -->

    </body>
</html>

